using System;
using System.Data;

namespace Core
{
    public class ColumnAttribute: Attribute
    {
        private bool _isPrimaryKey = false;
        public bool IsPrimaryKey
        {
            get { return _isPrimaryKey; }
            set { _isPrimaryKey = value; }
        }

        private bool _isIdentity = false;
        public bool IsIdentity
        {
            get { return _isIdentity; }
            set { _isIdentity = value; }
        }

        private bool _nullAble = false;
        public bool NullAble
        {
            get { return _nullAble; }
            set { _nullAble = value; }
        }

        string _columnName;
        public string ColumnName
        {
            get { return _columnName; }
            set { _columnName = value; }
        }

        int _columnLength;
        public int ColumnLength
        {
            get { return _columnLength; }
            set { _columnLength = value; }
        }

        SqlDbType _columnType;
        public SqlDbType ColumnType
        {
            get { return _columnType; }
            set { _columnType = value; }
        }

        public ColumnAttribute(string columnName, SqlDbType columnType, int columnLength, bool isPrimaryKey, bool isIdentity)
        {
            this.ColumnLength = columnLength;
            this.ColumnName = columnName;
            this.ColumnType = columnType;
            this.IsPrimaryKey = isPrimaryKey;
            this.IsIdentity = isIdentity;
        }

        public ColumnAttribute(string columnName, SqlDbType columnType, int columnLength, bool isPrimaryKey, bool isIdentity, bool nullAble)
        {
            this.ColumnLength = columnLength;
            this.ColumnName = columnName;
            this.ColumnType = columnType;
            this.IsPrimaryKey = isPrimaryKey;
            this.IsIdentity = isIdentity;
            this.NullAble = nullAble;
        }

        public ColumnAttribute(string columnName, SqlDbType columnType, int columnLength)
        {
            this.ColumnLength = columnLength;
            this.ColumnName = columnName;
            this.ColumnType = columnType;
        }
    }
}
